<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('member','header'); ?>
<div id="main">
<?php include template("member","left"); ?>
  <div id="right">
  <p id="position"><strong>当前位置：</strong><a href="">首页</a><a href="<?php echo $M['url'];?>member.php">我的广告</a><a>编辑广告</a><a><?php echo $_ads['adsname'];?></a></p>
    <script type="text/javascript" src="images/js/validator.js"></script>
    <form action="<?php echo $M['url'];?>member.php?action=<?php echo $action;?>&adsid=<?php echo $adsid;?>&dosubmit=1" method="post" name="myform" enctype="multipart/form-data">
      <table cellpadding="0" cellspacing="1" class="table_form">
        <caption>
        编辑广告
        </caption>
        <tr>
          <th width="150"><strong>广告位</strong></th>
          <td> <?php echo $placeid;?> <font color="red">*</font> </td>
        </tr>
        <tr>
          <th><strong>名称</strong></th>
          <td><input size=40 name="ads[adsname]" type="text" value="<?php echo $_ads['adsname'];?>" require='true' datatype='limit' min='5' msg='广告名称最少5个字!'>
            <font color="red">*</font> </td>
        </tr>
        <tr>
          <th><strong>介绍</strong></th>
          <td><input size=60 name="ads[introduce]" type="text" value="<?php echo $_ads['ads_introduce'];?>">
          </td>
        </tr>
        <tr>
          <th><strong>类型</strong></th>
          <td><input type='radio' name='ads[type]' value='image' onclick="alterUC('imageid')" <?php if($_ads[type]=='image') { ?>checked<?php } ?>>
            图片
            <input type='radio' name='ads[type]' value='flash' onclick="alterUC('flashid')" <?php if($_ads[type]=='flash') { ?>checked<?php } ?>>
            FLASH
            <input type='radio' name='ads[type]' value='text' onclick="alterUC('textid')" <?php if($_ads[type]=='text') { ?>checked<?php } ?>>
            文本
            <input type='radio' name='ads[type]' value='code' onclick="alterUC('codeid')" <?php if($_ads[type]=='code') { ?>checked<?php } ?>>
            文字链 <font color="red">*</font> </td>
        </tr>
        <tr>
          <th><strong>内容</strong></th>
          <td><table cellpadding="0" cellspacing="0" id="table">
              <tbody id="imageid" style="display:none">
                <tr>
                  <td> 上传图片：&nbsp;<?php echo $thumb;?>
                    <input type='hidden' name="ads[imageurl]" value="<?php echo $_ads['imageurl'];?>">
                    <font color="red">*</font><br/>
                    图片提示：
                    <input type="text" name="ads[alt]" size="50" value="<?php echo $_ads['alt'];?>">
                    <br/>
                    链接地址：
                    <input name="ads[linkurl]" type="text" size="50" value="<?php echo $_ads['linkurl'];?>">
                    <font color="red">*</font><br />
                    上传图片1：<?php echo $thumb1;?>
                    <input type='hidden' name="ads[s_imageurl]" value="<?php echo $_ads['s_imageurl'];?>">
                    <br />
                    (第二张图片当广告为随屏移动广告或者对联广告的时有效) </td>
                </tr>
              </tbody>
              <tbody id="flashid" style="display:none">
                <tr>
                  <td> FLASH地址：&nbsp;<?php echo $flash;?>
                    <input type='hidden' name="ads[flashurl]" value="<?php echo $_ads['flashurl'];?>">
                    <font color="red">*</font><br/>
                    背景透明：
                    <input type='radio' name='ads[wmode]' value='transparent' <?php if($_ads['wmode']=='transparent') { ?>checked<?php } ?>>
                    是
                    <input type='radio' name='ads[wmode]' value='' <?php if($_ads['wmode']=='') { ?>checked<?php } ?>>
                    否 </td>
                </tr>
              </tbody>
              <tbody id="textid" style="display:none">
                <tr>
                  <td><textarea name='ads[text]' cols='64' rows='15' id='text'><?php echo $_ads['text'];?></textarea>
                    <font color="red">*</font> </td>
                </tr>
              </tbody>
              <tbody id="codeid" style="display:none">
                <tr>
                  <td>链接内容：
                    <input type='text' name='ads[code]' size=40 value='<?php echo $_ads['code'];?>'>
                    <font color="red">*</font><br />
                    链接地址：
                    <input type='text' name='ads[text_link]' size=40 value='<?php echo $_ads['linkurl'];?>'>
                    <font color="red">*</font> </td>
                </tr>
              </tbody>
            </table></td>
        </tr>
        <tr>
          <td></td>
          <td><input type="submit" name="submit" value=" 修改 ">
            &nbsp;
            <input type="reset" name="reset" value=" 清除 ">
          </td>
        </tr>
      </table>
    </form>
  </div>
</div>
<script>
function alterUC(eID) {
$("#table tbody").hide();
$("#"+eID).show();
}
alterUC("<?php echo $_ads['type'];?>id");
$('form').checkForm(1);
$('form').checkForm(1);
</script>
<?php include template('phpcms','footer'); ?>